function UnitTests:testSentences()

	local descriptor =
	{
		{
			s = {"Character", "Toto"},
			p = 
			{
				{ v = "isAt", doj = {"Location", "Home"}},
				{ c = "and", a = {"inocently", "surely"}, v = "isA", doj = {"FunyGuy"} },
			}
		},	
		{
			s = {"Location", "School"},
			p = 
			{
				{ v = "isNear", doj = {"Location", "Home"}},
				{ c = "and", v = "isA", doj = {"NicePlace"} },
			}
		},	
	}
	
	local sentence = Sentence:new(descriptor)
	
	--print(tostring(sentence))
	
	assert(
		tostring(sentence) == 
		"snt{ < Character:Toto [ isAt doj( Location:Home ) ] and[ isA a( inocently surely ) doj( FunyGuy:nil ) ] > < Location:School [ isNear doj( Location:Home ) ] and[ isA doj( NicePlace:nil ) ] > }"
	)
	
	---
	
	local splitedSentence = sentence:split()
	
	--[[
		print(splitedSentence[1])
		print(splitedSentence[2])
		print(splitedSentence[3])
		print(splitedSentence[4])
	]]--
	
	assert(tostring(splitedSentence[1]) == "snt{ < Character:Toto [ isAt doj( Location:Home ) ] > }")
	assert(tostring(splitedSentence[2]) == "snt{ < Character:Toto and[ isA a( inocently surely ) doj( FunyGuy:nil ) ] > }")
	assert(tostring(splitedSentence[3]) == "snt{ < Location:School [ isNear doj( Location:Home ) ] > }")
	assert(tostring(splitedSentence[4]) == "snt{ < Location:School and[ isA doj( NicePlace:nil ) ] > }")
	
	assert(splitedSentence[1]:equal(splitedSentence[1]:split()[1]))

	---
	
	local descriptor2 =
	{
		{
			s = {"Character", "Toto"},
			p = 
			{
				{ v = "isAt", doj = {"Location", "Home"}},
				{ c = "and", a = {"inocently", "surely"}, v = "isA", doj = {"FunyGuy"} },
			}
		},	
		{
			s = {"Location", "School"},
			p = 
			{
				{ v = "isNear", doj = {"Location", "Home"}},
				{ c = "and", v = "isA", doj = {"NicePlace"} },
			}
		},	
	}
	
	local sentence2 = Sentence:new(descriptor2)
	
	assert(sentence:equal(sentence2))
	
	---
		
	descriptor =
	{
		{
			s = {"Character", "Toto"},
			p = 
			{
				{ v = "isAt", doj = {"Location", "Home"}},
				{ c = "and", v = "isA", doj = {"FunyGuy"} },
			}
		},	
		{
			s = {"Location", "School"},
			p = 
			{
				{ v = "isNear", doj = {"Location", "Home"}},
				{ c = "and", v = "isA", doj = {"NicePlace"} },
			}
		},	
	}

	sentence = Sentence:new(descriptor)
		
	descriptor2 =
	{
		{
			s = {"Character", "Toto"},
			p = 
			{
				{ v = "isAt", doj = {"Location", "Home"}},
				{ c = "and", v = "isA", doj = {"FunyGuy"} },
			}
		},	
		{
			s = {"Location", "School"},
			p = 
			{
				{ v = "isNear", doj = {"Location", "Home"}},
				{ c = "and", v = "isA", doj = {"NicePlace"} },
			}
		},	
	}
	
	sentence2 = Sentence:new(descriptor2)
	
	assert(sentence:equal(sentence2))
	
	---
	
	descriptor2 =
	{
		{
			s = {"Character", "Toto"},
			p = 
			{
				{ v = "isAt", doj = {"Location", "Home"}},
				{ c = "and", v = "isA", doj = {"FunyGuy"} },
			}
		},	
		{
			s = {"Location", "School"},
			p = 
			{
				{ v = "isNear", doj = {"Location", "Home"}},
				{ c = "and", v = "isA", doj = {"AwfullPlace"} },
			}
		},	
	}
	
	sentence2 = Sentence:new(descriptor2)
	
	assert(not sentence:equal(sentence2))
	
	---
	
	descriptor =
	{
		s = {"Character", "Toto"},
		p = 
		{
			{ v = "isAt", doj = {"Location", "Home"}},
			{ c = "and", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	sentence = Sentence:new(descriptor)
	
	--print(tostring(sentence))
	
	assert(
		tostring(sentence) == 
		"snt{ < Character:Toto [ isAt doj( Location:Home ) ] and[ isA doj( FunyGuy:nil ) ] > }"
	)

	---
		
	descriptor2 =
	{
		s = {"Character", "Toto"},
		p = 
		{
			{ v = "isAt", doj = {"Location", "Home"}},
			{ c = "and", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	sentence2 = Sentence:new(descriptor2)	
	
	assert(sentence:equal(sentence2))
	
	---
	
	descriptor2 =
	{
		s = {"Character", "Toto"},
		p = 
		{
			{ v = "isAt", doj = {"Location", "Home"}},
			{ c = "or", v = "isA", doj = {"FunyGuy"} },		-- conjuction is different
		}	
	}
	
	sentence2 = Sentence:new(descriptor2)	
	
	assert(not sentence:equal(sentence2))
	
	---
	
	descriptor2 =
	{
		s = {"Character", "Titi"},								-- subject name is different
		p = 
		{
			{ v = "isAt", doj = {"Location", "Home"}},
			{ c = "and", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	sentence2 = Sentence:new(descriptor2)	
	
	assert(not sentence:equal(sentence2))
	
	---
	
	descriptor2 =
	{
		s = {"Character", "Toto"},
		p = 
		{
			{ v = "isAt", doj = {"Location", "School"}},	-- direct object name is different
			{ c = "and", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	sentence2 = Sentence:new(descriptor2)	
	
	assert(not sentence:equal(sentence2))
	
	---
	
	descriptor2 =
	{
		s = {"Character", "Toto"},
		p = 
		{
			{ v = "isAt", a = {"not"}, doj = {"Location", "School"}},	-- direct object name is different
			{ c = "and", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	sentence2 = Sentence:new(descriptor2)	
	
	assert(sentence:equal(sentence2))
	assert(sentence2:equal(sentence))
	
	---
	
	descriptor2 =
	{
		s = {"Character", "Toto"},
		p = 
		{
			{ v = "isAt", doj = {"Room", "Home"}},			-- direct object type is different
			{ c = "and", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	sentence2 = Sentence:new(descriptor2)	
	
	assert(not sentence:equal(sentence2))
	
	---
	
	local descriptor3 =
	{
		s = {"Character", "Toto"},
		p = 
		{
			{ v = "isAt", doj = {"*", "Home"}},
			{ c = "and", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	local sentence3 = Sentence:new(descriptor3)	
	
	assert(sentence3:equal(sentence))	
	assert(sentence3:equal(sentence2))	
	
	---
	
	descriptor2 =
	{
		s = {"Character", "Toto"},
		p = 
		{
			{ v = "isAt", doj = {"Location", "Shop"}},
			{ c = "and", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	sentence2 = Sentence:new(descriptor2)	
	
	descriptor3 =
	{
		s = {"Character", "Toto"},
		p = 
		{
			{ v = "isAt", doj = {"Location", "*"}},
			{ c = "and", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	sentence3 = Sentence:new(descriptor3)	
	
	assert(sentence3:equal(sentence))	
	assert(sentence3:equal(sentence2))		
	
	---
	
	descriptor2 =
	{
		s = {"Character", "Titi"},
		p = 
		{
			{ v = "isAt", doj = {"Location", "Home"}},
			{ c = "and", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	sentence2 = Sentence:new(descriptor2)	
	
	descriptor3 =
	{
		s = {"Character", "*"},
		p = 
		{
			{ v = "isAt", doj = {"Location", "Home"}},
			{ c = "and", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	sentence3 = Sentence:new(descriptor3)	
	
	assert(sentence3:equal(sentence))	
	assert(sentence3:equal(sentence2))		
	
	---
	
	descriptor2 =
	{
		s = {"Character", "*"},
		p = 
		{
			{ v = "isAt", doj = {"Location", "Home"}},			
			{ c = "and", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	sentence2 = Sentence:new(descriptor2)	
	
	descriptor3 =
	{
		s = {"Character", "Titi"},
		p = 
		{
			{ v = "isAt", doj = {"Location", "Home"}},
			{ c = "and", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	sentence3 = Sentence:new(descriptor3)	
	
	assert(not sentence3:equal(sentence))	
	assert(sentence3:equal(sentence2))		
	
	---
	
	descriptor2 =
	{
		s = {"Bot", "Toto"},
		p = 
		{
			{ v = "isAt", doj = {"Location", "Home"}},			
			{ c = "and", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	sentence2 = Sentence:new(descriptor2)	
	
	descriptor3 =
	{
		s = {"*", "Toto"},
		p = 
		{
			{ v = "isAt", doj = {"Location", "Home"}},
			{ c = "and", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	sentence3 = Sentence:new(descriptor3)	
	
	assert(sentence3:equal(sentence))	
	assert(sentence3:equal(sentence2))		
	
	---
	
	descriptor2 =
	{
		s = {"*", "Toto"},
		p = 
		{
			{ v = "isAt", doj = {"Location", "Home"}},	
			{ c = "and", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	sentence2 = Sentence:new(descriptor2)	
	
	descriptor3 =
	{
		s = {"Bot", "Toto"},
		p = 
		{
			{ v = "isAt", doj = {"Location", "Home"}},
			{ c = "and", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	sentence3 = Sentence:new(descriptor3)	
	
	assert(not sentence3:equal(sentence))	
	assert(sentence3:equal(sentence2))		
	
	---
	
	descriptor2 =
	{
		s = {"Character", "Toto"},
		p = 
		{
			{ v = "isAt", doj = {"Location", "Home"}},			
			{ c = "or", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	sentence2 = Sentence:new(descriptor2)	
	
	descriptor3 =
	{
		s = {"Character", "Toto"},
		p = 
		{
			{ v = "isAt", doj = {"Location", "Home"}},
			{ c = "*", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	sentence3 = Sentence:new(descriptor3)	
	
	assert(sentence3:equal(sentence))	
	assert(sentence3:equal(sentence2))		
	
	---
	
	descriptor2 =
	{
		s = {"Character", "Toto"},
		p = 
		{
			{ v = "isAt", doj = {"Location", "Home"}},	
			{ c = "*", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	sentence2 = Sentence:new(descriptor2)	
	
	descriptor3 =
	{
		s = {"Character", "Toto"},
		p = 
		{
			{ v = "isAt", doj = {"Location", "Home"}},
			{ c = "or", v = "isA", doj = {"FunyGuy"} },
		}	
	}
	
	sentence3 = Sentence:new(descriptor3)	
	
	assert(not sentence3:equal(sentence))	
	assert(sentence3:equal(sentence2))		
	
	---
	
	descriptor2 =
	{
		s = {"Character", "Toto"},
		p = 
		{
			{ v = "isAt", doj = {"Location", "Home"}},			
			{ c = "and", v = "isFor", doj = {"FunyGuy"} },
		}	
	}
	
	sentence2 = Sentence:new(descriptor2)	
	
	descriptor3 =
	{
		s = {"Character", "Toto"},
		p = 
		{
			{ v = "isAt", doj = {"Location", "Home"}},
			{ c = "and", v = "*", doj = {"FunyGuy"} },
		}	
	}
	
	sentence3 = Sentence:new(descriptor3)	
	
	assert(sentence3:equal(sentence))	
	assert(sentence3:equal(sentence2))		
	
	---
	
	descriptor2 =
	{
		{
			s = {"Character", "Toto"},
			p = 
			{
				{ v = "isAt", doj = {"Location", "Home"}},	
				{ c = "and", v = "*testVariable", doj = {"FunyGuy"} },
			}
		},	
		{
			s = {"Character", "Titi"},
			p = 
			{
				{ v = "@testVariable", doj = {"CoolGuy"}}	
			}
		}	
	}
	
	sentence2 = Sentence:new(descriptor2)	
	
	descriptor3 =
	{
		{
			s = {"Character", "Toto"},
			p = 
			{
				{ v = "isAt", doj = {"Location", "Home"}},	
				{ c = "and", v = "isA", doj = {"FunyGuy"} },
			}
		},	
		{
			s = {"Character", "Titi"},
			p = 
			{
				{ v = "isA", doj = {"CoolGuy"}}	
			}
		}	
	}
	
	sentence3 = Sentence:new(descriptor3)	
	
	assert(not sentence3:equal(sentence))	
	assert(sentence2:equal(sentence3))	
	assert(sentence3:equal(sentence2))	
	assert(sentence2.matchingVariables.testVariable == "isA")
	
	---
	
	descriptor3 =
	{
		{
			s = {"Character", "Toto"},
			p = 
			{
				{ v = "isAt", doj = {"Location", "Home"}},	
				{ c = "and", v = "isA", doj = {"FunyGuy"} },
			}
		},	
		{
			s = {"Character", "Titi"},
			p = 
			{
				{ v = "isNotA", doj = {"CoolGuy"}}	
			}
		}	
	}
	
	sentence3 = Sentence:new(descriptor3)
	assert(not sentence2:equal(sentence3))	
	assert(not sentence3:equal(sentence2))
	
	---
		
	descriptor3 =
	{
		{
			s = {"@initalVariableTest1", "@initalVariableTest2"},
			p = 
			{
				{ v = "isAt", doj = {"Location", "Home"}},	
				{ c = "and", v = "isA", doj = {"FunyGuy"} },
			}
		},	
		{
			s = {"Character", "Titi"},
			p = 
			{
				{ v = "isA", doj = {"CoolGuy"}}	
			}
		}	
	}
	
	sentence3 = Sentence:new(descriptor3)
	local initialVariables =
	{
		initalVariableTest1 = "Character",
		initalVariableTest2 = "Toto"	
	}
	assert(sentence2:equal(sentence3, initialVariables))	
	assert(sentence3:equal(sentence2, initialVariables))	
	assert(not sentence2:equal(sentence3))	
	assert(not sentence3:equal(sentence2))	

	---

	descriptor3 =
	{
		{
			s = {"@{initalVariableTest1}", "@{initalVariableTest2}"},
			p = 
			{
				{ v = "isAt", doj = {"Location", "Home"}},	
				{ c = "and", v = "isA", doj = {"FunyGuy"} },
			}
		},	
		{
			s = {"Character", "Titi"},
			p = 
			{
				{ v = "isA", doj = {"CoolGuy"}}	
			}
		}	
	}
	
	sentence3 = Sentence:new(descriptor3)
	initialVariables =
	{
		initalVariableTest1 = {"Bot", "Duck", "Character", "Palm"},
		initalVariableTest2 = {"Tutu", "Marcel", "Toto", "Nestor"}	
	}
	assert(sentence2:equal(sentence3, initialVariables))	
	assert(sentence3:equal(sentence2, initialVariables))	
	assert(sentence3:equal(sentence3, initialVariables))
	
	---
		
	initialVariables =
	{
		initalVariableTest1 = {"Bot", "Duck", "Palm"},
		initalVariableTest2 = {"Tutu", "Marcel", "Nestor"}	
	}
	assert(not sentence2:equal(sentence3, initialVariables))	
	assert(not sentence3:equal(sentence2, initialVariables))	
	
	---
		
	initialVariables =
	{
		initalVariableTest1 = {"Bot", "Duck", "Palm"},
		initalVariableTest2 = {"Toto", "Tutu", "Marcel", "Nestor"}	
	}
	assert(not sentence2:equal(sentence3, initialVariables))	
	assert(not sentence3:equal(sentence2, initialVariables))	
end
